package com.yuanlrc.base.schedule.admin;

import com.yuanlrc.base.service.admin.BorrowService;
import com.yuanlrc.base.service.admin.ViolationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * 借阅逾期定时器
 */
@Configuration
@EnableScheduling
public class BorrowSchedule {

    @Autowired
    private BorrowService borrowService;

    private Logger log = LoggerFactory.getLogger(BorrowSchedule.class);

    @Scheduled(cron="1 * * * * ?")//每天凌晨一点0分0秒执行备份任务
    public void addOverdue(){
        log.info("开始执行定时添加逾期记录任务!");
         borrowService.addRecord();
    }

}
